package so.ifl.commons.tools.pinter;


import so.ifl.commons.tools.StringHelper;
import so.ifl.commons.tools.pinter.impl.ApplyFormBlankPrinter;
import so.ifl.commons.tools.pinter.impl.ApplyFromPrinter;
import so.ifl.commons.tools.pinter.impl.BodyCheckBlankPrinter;
import so.ifl.commons.tools.pinter.impl.BodyCheckPrinter;
import so.ifl.commons.tools.pinter.impl.ReceiptPrinter;
import so.ifl.commons.tools.pinter.impl.ResultBillBlankPrinter;
import so.ifl.commons.tools.pinter.impl.ResultBillPrinter;
import so.ifl.commons.tools.pinter.impl.Subject1Printer;
import so.ifl.commons.tools.pinter.impl.Subject2Printer;
import so.ifl.commons.tools.pinter.impl.Subject3Printer;
import so.ifl.commons.tools.pinter.impl.Subject4Printer;
import so.ifl.commons.tools.pinter.impl.Subject5Printer;
import so.ifl.commons.tools.pinter.impl.Sum1Printer;
import so.ifl.commons.tools.pinter.impl.Sum2Printer;
import so.ifl.commons.tools.pinter.impl.custom.CustomSubject4Printer;

/**
 *create by aaron.lu
 *create at 2012-2-20 下午11:39:04
 *<mailto: atyuan.lu@gmail.com>
 **/
public class PrinterFactory {
	
	public static String SUBJECT1 = "subject1";
	public static String SUBJECT2 = "subject2";
	public static String SUBJECT3 = "subject3";
	public static String SUBJECT4 = "subject4";
	public static String SUBJECT5 = "subject5";
	public static String APPLY_FORM = "apply_form";
	public static String BODY_CHECK = "body_check";
	public static String RESULT_BILL = "result_bill";
	public static String CUSTOME_SUBJECT4 = "custome_sucject4";
	public static String RECEIPT = "receipt";
	public static String SUM1 = "sum1";
	public static String SUM2 = "sum2";
	public static String APPLY_FORM_BLANK = "apply_form_blank";
	public static String BODY_CHECK_BLANK = "body_check_blank";
	public static String RESULT_BILL_BLANK = "result_bill_blank";
	
	//工厂方法
	public static Iprinter getPrinter(String which){
		if (StringHelper.isNotEmpty(which)) {
			
			if (which.equals(PrinterFactory.SUBJECT1)) {
				return new Subject1Printer();
			}
			if (which.equals(PrinterFactory.SUBJECT2)) {
				return new Subject2Printer();
			}
			if (which.equals(PrinterFactory.SUBJECT3)) {
				return new Subject3Printer();
			}
			if (which.equals(PrinterFactory.SUBJECT4)) {
				return new Subject4Printer();
			}
			if (which.equals(PrinterFactory.SUBJECT5)) {
				return new Subject5Printer();
			}
			if (which.equals(PrinterFactory.APPLY_FORM)) {
				return new ApplyFromPrinter();
			}
			if (which.equals(PrinterFactory.BODY_CHECK)) {
				return new BodyCheckPrinter();
			}
			if (which.equals(PrinterFactory.RESULT_BILL)) {
				return new ResultBillPrinter();
			}			
			if (which.equals(PrinterFactory.CUSTOME_SUBJECT4)) {
				return new CustomSubject4Printer();
			}
			if (which.equals(PrinterFactory.RECEIPT)) {
				return new ReceiptPrinter();
			}
			if (which.equals(PrinterFactory.SUM1)) {
				return new Sum1Printer();
			}
			if (which.equals(PrinterFactory.SUM2)) {
				return new Sum2Printer();
			}
			if(which.equals(PrinterFactory.APPLY_FORM_BLANK)){
				return new ApplyFormBlankPrinter();
			}
			if(which.equals(PrinterFactory.BODY_CHECK_BLANK)){
				return new BodyCheckBlankPrinter();
			}
			if(which.equals(PrinterFactory.RESULT_BILL_BLANK)){
				return new ResultBillBlankPrinter();
			}
		}
		
		return null;
	}
}
